package main.social.web;

import java.util.Map;

import main.social.service.EntryService;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping(value = "/Home")
public class HomeController {

	EntryService entryService;
	
	public void setEntryService(EntryService entryService) {
		this.entryService = entryService;
	}

	@RequestMapping(method = RequestMethod.GET)
	public ModelAndView doGet(){
		ModelAndView mav = new ModelAndView("Home");
		Map<String, Object> model = this.entryService.getWeeklyEntrys();
		mav.addAllObjects(model);
		return mav;
	}
}
